<script>
import NewmyTable from "@/components/NewmyTable.vue"
import { tableData } from "./config.js"

const prevTableCol = [
  {
    fixed: "left",
    type: "selection",
    width: "50",
    align: "center"
  },
  {
    prop: "index",
    label: "序号",
    type: "index",
    align: "center",
    minWidth: "100"
  },
  {
    prop: "code",
    label: "产业编码",
    align: "center",
    minWidth: "100",
    optionListAttrs: ({ row, $index }) => [
      {
        btnText: row.date,
        type: "primary",
        link: true,
        // onClick: () => turnToSearch(row)
      }
    ]
  },
  {
    prop: "name",
    label: "产业圈名称",
    align: "center",
    minWidth: "145",
    optionListAttrs: ({ row, $index }) => [
      {
        btnText: row.name,
        type: "primary",
        link: true
        // onClick: () => trunToBuild(row, "read")
      }
    ]
  }
]

export default {
  computeds: {
    NewmyTable

  },
  setup() {
    const handleSelectionChange = (selectedRows) => {
      console.log("Selected Rows:", selectedRows)
      // 在这里处理选中的行数据
    }
    return {
      tableData,
      prevTableCol,
      handleSelectionChange
    }
  }

}
</script>

<template>
  <div>
    <NewmyTable
      ref="newTableref"
      :tableData="tableData"
      :tableHeaders="prevTableCol"
      @selection-change="handleSelectionChange"
    ></NewmyTable>
  </div>
</template>

<style>
</style>
